using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DmServer.Handlers.Handlers
{
    public class KeyUpChar : IMessageHandler
    {
        public void HandleMessage(StringRequestInfo? request, TcpSessionClient client, DmSoft dm)
        {
            if (request?.Parameters == null || request.Parameters.Length != 1)
                client.SendAsync(CryptoHelper.EncryptDES("协议命令错误！"));

            string key_str = request?.Parameters?[0] ?? "";
            var result = dm.KeyUpChar(key_str);
            client.Logger.Info("KeyUpChar：" + result.ToString());
            // 回复客户端消息
            client.SendAsync(CryptoHelper.EncryptDES(result.ToString()));
        }
    }
}
